<?php  if ( ! defined('CentPHP')) exit( "Disallow to access direct!" );
/*
    |====================================================|
	|  CentPHP                                           |
	|----------------------------------------------------|
	|  package      lib/kernel/Class.Controller.php      |
	|  auther       Boyu Sun                             |
	|  copyright    Copyright (c) 2008, sunboyu.cn       |
	|  license      freebsd-license                      |
	|  link         www.sunboyu.cn                       |
	|  version      Version 0.1                          |
	|====================================================|
*/

/*
    +-------------------------------------------------------------------
	| class Controller
	| Detecting routing.
	+-------------------------------------------------------------------
*/

class Controller extends CP
{
	/*
	 *  Constructor
	 *
	 */
	function Controller()
	{
		parent::CP();
	}

	/*
	 *  Load class default
	 *  @param array()
	 *  @retrun null
	 */
	function _init( $classnames = array() )
	{
		$classnames = array(
			'View'  => 'View',
		    'Mysql' => 'Mysql',
		    'URI'   => 'URI'
		);
		if(is_array($classnames))
		{
			foreach( $classnames as $key => $value )
			{
				$this->$key = &new_class( $value );
			}
		}
		$this->View->_init( load_config( 'View' ) );
		$this->Mysql->_init( load_config( 'Mysql' ) );
	}
}
?>